package project.layer.agents;

import project.data.EvaporableData;
import project.data.EvaporableDataHolder;
import project.data.Intention;
import project.layer.ant.AntLayer;
import project.layer.ant.FeasibilityAnt;
import project.layer.physical.PackagePoint;
import framework.layer.agent.Agent;

public abstract class PackagePointAgent extends Agent implements EvaporableDataHolder {
	
	protected Intention currentIntention;
	
	private int packageID;
	
	
	public int getPackageID() {
		return packageID;
	}

	private final int TURNOVER_COUNT = 50;
	private int ticksLeft;
	
	public PackagePointAgent(int packageID){
		this.packageID = packageID;
	}
	
	public boolean hasIntention(){
		return getCurrentIntention() != null;
	}

	public Intention getCurrentIntention() {
		return currentIntention;
	}

	protected void setCurrentIntention(Intention currentIntention) {
		this.currentIntention = currentIntention;
	}
	
	public void remove(EvaporableData intention){
		if(getCurrentIntention().equals(intention)){
			

			setCurrentIntention(null);			
		}

	}
	
	@Override
	public void processTick(long timePassed) {
		if (ticksLeft == 0) {
			sendFeasibilityAntIfNecessary();
			ticksLeft = TURNOVER_COUNT;
		}
		ticksLeft--;

	}
	
	protected abstract void sendFeasibilityAntIfNecessary();
	protected abstract void sendFeasibilityAnt();
	

	@Override
	public void executeDeploymentOptions() {
		// TODO Auto-generated method stub

	}
	
	public boolean isPickUpPointAgent(){
		return false;
	}
	
	public boolean isDropOffPointAgent(){
		return false;
	}
//	public abstract PackagePoint getPackagePoint();

}
